package com.itheima.client.fallback;

import com.itheima.client.AddressClient;
import com.itheima.po.Address;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;

import java.util.List;

/**
 * @author zhanliuzhu
 * @date 2023/10/29
 * @Description
 */
@Slf4j
public class AddressClientFallBack implements FallbackFactory<AddressClient> {
    @Override
    public AddressClient create(Throwable cause) {
        log.info("调用address接口失败{}", cause);
        return new AddressClient() {
            @Override
            public List<Address> getByUserId(Long id) {
                return null;
            }
        };
    }
}
